package com.liao.seckill.result;

import lombok.Data;
import lombok.Getter;

@Getter
public enum ResultCode {



    SERVER_ERROR(10000,"服务器错误"),
    SUCCESS(20000,"请求成功"),
    PASSWORD_ERROR(30001,"用户名或密码错误"),
    ACCOUNT_ERROR(30002,"用户未注册"),
    CAPTCHA_ERROR(30003,"验证码错误"),
    UNAUTHORIZED_ERROR(30004,"用户未登录"),
    TOKEN_ERROR(30005,"token异常"),
    PARAMETER_ERROR(40001,"入参异常"),
    GOODS_ERROR(50000,"商品异常"),
    GOODS_UNDER_STOCK(50001,"库存不足"),
    GOODS_NOTFOUND(50002,"商品未找到"),
    GOODS_MIAOSHA_ERROR(51000,"秒杀异常"),
    GOODS_MIAOSHA_NOT_START(51001,"秒杀未开始"),
    GOODS_MIAOSHA_IS_END(51002,"秒杀已结束"),
    GOODS_MIAOSHA_FILE(51003,"秒杀失败"),
    ORDER_ERROR(60000,"订单异常"),
    ORDER_CREATE_ERROR(60001,"订单创建失败"),
    ORDER_CREATED(60002,"订单重复创建"),
    ORDER_NOTFOUND(60003,"订单未找到");

    private Integer code;
    private String msg;

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
